<?php

namespace flat;

abstract class DataType {
    
    /**
     * Converts $value to be used in PHP
     */
    public abstract function toPhp($value);
    
    /**
     * Converts $value to be stored in db
     */
    public abstract function toDb($value);
    
    /**
     * Converts $value to view format
     */
    public function toView($value) {
        return $this->toPhp($value);
    }
    
}
